from activity_manager.models import Activity
from django.shortcuts import render_to_response, get_object_or_404

def index(request):
	latest_activity_list = Activity.objects.all().order_by('-pub_date')[:5]
	return render_to_response('activity_manager/index.html', {'latest_activity_list': latest_activity_list})

def detail(request, activity_id):
    a = get_object_or_404(Activity, pk=activity_id)
    return render_to_response('activity_manager/detail.html', {'activity': a})